package com.vn.entity;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="Land")
public class Land {
	
	public Land(){
		
	}
	
	public Land(String address, String nearLandMark, double area,
			Date datePurchase, Location location, String landDescription, Storage storage,
			String log, boolean deleted) {
		super();
		this.address = address;
		this.nearLandMark = nearLandMark;
		this.area = area;
		this.datePurchase = datePurchase;
		this.location=location;
		this.planDescription = landDescription;
		this.storage = storage;
		this.log = log;
		this.deleted = deleted;
	}

	@Id
	@GeneratedValue
	@Column(name="IDLand")
	private int id;
	
	@Column(name="Address")
	private String address;
	
	@Column(name="NearLandMark")
	private String nearLandMark;
	
	@Column(name="Area")
	private double area;
	
	@Column(name="DatePurchase")
	private Date datePurchase;
	
	@JoinColumn(name="LocationID",referencedColumnName="IDLocation")
	@ManyToOne
	private Location location;
	
	@Column(name="PlanDescription")
	private String planDescription;
	
	@JoinColumn(name="FolderName",referencedColumnName="FolderName")
	@ManyToOne
	private Storage storage;
	
	@Column(name="Log")
	private String log;
	
	@Column(name="Deleted")
	private boolean deleted=false;
	
	@OneToMany
	private List<Building> buildings;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getNearLandMark() {
		return nearLandMark;
	}

	public void setNearLandMark(String nearLandMark) {
		this.nearLandMark = nearLandMark;
	}

	public double getArea() {
		return area;
	}

	public void setArea(double area) {
		this.area = area;
	}

	public Date getDatePurchase() {
		return datePurchase;
	}

	public void setDatePurchase(Date datePurchase) {
		this.datePurchase = datePurchase;
	}

	public String getPlanDescription() {
		return planDescription;
	}

	public void setPlanDescription(String landDescription) {
		this.planDescription = landDescription;
	}

	public Storage getStorage() {
		return storage;
	}

	public void setStorage(Storage storage) {
		this.storage = storage;
	}

	public String getLog() {
		return log;
	}

	public void setLog(String log) {
		this.log = log;
	}

	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	public Location getLocation() {
		return location;
	}

	public void setLocation(Location location) {
		this.location = location;
	}

}
